package com.yanqu.xiuxian.gameserver.tripletown.entity;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 三消-订单
 */
public class Order {

    private int orderId;                        // 订单ID
    private int curStep;                        // 目前步数
    private int maxStep;                        // 最大步数
    private Map<Integer, OrderProg> progMap;    // 订单任务详情
    private String reward;                      // 奖励

    public Order() {
        this.orderId = 0;
        this.curStep = 0;
        this.maxStep = 0;
        this.progMap = new ConcurrentHashMap<>();
        this.reward = "";
    }

    public Order(int orderId, int curStep, int maxStep, Map<Integer, OrderProg> progMap, String reward) {
        this.orderId = orderId;
        this.curStep = curStep;
        this.maxStep = maxStep;
        this.progMap = progMap;
        this.reward = reward;
    }

    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    public int getCurStep() {
        return curStep;
    }

    public void setCurStep(int curStep) {
        this.curStep = curStep;
    }

    public int getMaxStep() {
        return maxStep;
    }

    public void setMaxStep(int maxStep) {
        this.maxStep = maxStep;
    }

    public Map<Integer, OrderProg> getProgMap() {
        return progMap;
    }

    public void setProgMap(Map<Integer, OrderProg> progMap) {
        this.progMap = progMap;
    }

    public String getReward() {
        return reward;
    }

    public void setReward(String reward) {
        this.reward = reward;
    }

    public void addStep(int step) {
        this.curStep += step;
    }

    public Order clone() {
        Order orderClone = new Order();
        orderClone.setOrderId(this.orderId);
        orderClone.setCurStep(this.curStep);
        orderClone.setMaxStep(this.maxStep);
        orderClone.setProgMap(new ConcurrentHashMap<>(this.progMap));
        orderClone.setReward(this.reward);
        return orderClone;
    }

}
